package PTA1.ti4;

import java.util.Scanner;

/**
 * @author Lenovo
 */
public class Main {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        while (scanner.hasNext()) {
            String input = scanner.next();
            double x;
            try {
                x = Double.parseDouble(input);
            } catch (NumberFormatException e) {
                continue;
            }
            if (x < 0) {
                System.out.println("NaN");
            } else if (x == 0) {
                System.out.println("0.000000");
            } else {
                double result = 0.0;
                double currentSquare = 0.0;
                double step = 0.0001;
                double epsilon = 0.0001;

                while (currentSquare < x && (x - currentSquare) > epsilon) {
                    result += step;
                    currentSquare = result * result;
                }

                System.out.printf("%.6f\n", result);
            }
        }
        scanner.close();
    }
}